﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="SceneDetails.aspx.vb" Inherits="helzwebscripting.SceneDetails" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1 class="bigHeadings">Twilighters Community Scenes</h1>
    <%# Eval("SceneName")%>  
        <asp:GridView CssClass="detailImg" runat="server" AutoGenerateColumns="False" GridLines="None" 
            DataSourceID="SqlDataSource5">
            <Columns>
                <asp:ImageField DataImageUrlField="SceneImg">
                </asp:ImageField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
            ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
            ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
            SelectCommand="SELECT [SceneImg] FROM [SceneList] WHERE ([ID] = ?)">
            <SelectParameters>
                <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    <%--GRIDVIEW FOR EXTRA URL LINK--%>    
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None" 
        DataSourceID="SqlDataSource4">
        <Columns>
        <asp:TemplateField>
            <ItemTemplate>
            <div class="nameLabel">
                <%# Eval("SceneName")%>
                </div>
                </ItemTemplate>
                </asp:TemplateField>      
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT [SceneName] FROM [SceneList] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    <%--LISTVIEW FOR CHARACTERS, BOOK, DESCRIPTION, TWIWRITER & DATE ADDED--%>  
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
        <AlternatingItemTemplate>
            <td runat="server" style="">
                KeyCharacters:
                <asp:Label ID="KeyCharactersLabel" runat="server" 
                    Text='<%# Eval("KeyCharacters") %>' />
                <br />
                KeyBook:
                <asp:Label ID="KeyBookLabel" runat="server" 
                    Text='<%# Eval("KeyBook") %>' />
                <br />
                SceneDescription:
                <asp:Label ID="SceneDescriptionLabel" runat="server" 
                    Text='<%# Eval("SceneDescription") %>' />
                <br />
                TwiWriter: <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'><%# Eval("TwiWriter") %></a>
                <br />
                DateUploaded:
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
            </td>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <td runat="server" style="">
                KeyCharacters:
                <asp:TextBox ID="KeyCharactersTextBox" runat="server" 
                    Text='<%# Bind("KeyCharacters") %>' />
                <br />
                KeyBook:
                <asp:TextBox ID="KeyBookTextBox" runat="server" 
                    Text='<%# Bind("KeyBook") %>' />
                <br />
                SceneDescription:
                <asp:TextBox ID="SceneDescriptionTextBox" runat="server" 
                    Text='<%# Bind("SceneDescription") %>' />
                <br />
                TwiWriter:
                <asp:TextBox ID="TwiWriterTextBox" runat="server" 
                    Text='<%# Bind("TwiWriter") %>' />
                <br />
                DateUploaded:
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                    Text="Update" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Cancel" />
            </td>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <td runat="server" style="">
                KeyCharacters:
                <asp:TextBox ID="KeyCharactersTextBox" runat="server" 
                    Text='<%# Bind("KeyCharacters") %>' />
                <br />
                KeyBook:
                <asp:TextBox ID="KeyBookTextBox" runat="server" 
                    Text='<%# Bind("KeyBook") %>' />
                <br />
                SceneDescription:
                <asp:TextBox ID="SceneDescriptionTextBox" runat="server" 
                    Text='<%# Bind("SceneDescription") %>' />
                <br />
                TwiWriter:
                <asp:TextBox ID="TwiWriterTextBox" runat="server" 
                    Text='<%# Bind("TwiWriter") %>' />
                <br />
                DateUploaded:
                <asp:TextBox ID="DateUploadedTextBox" runat="server" 
                    Text='<%# Bind("DateUploaded") %>' />
                <br />
                <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                    Text="Insert" />
                <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                    Text="Clear" />
            </td>
        </InsertItemTemplate>
        <ItemTemplate>
            <td runat="server" class="listviewText" style="">
                <span class="listviewLabel">Key Characters:</span>
                <asp:Label ID="KeyCharactersLabel" runat="server" 
                    Text='<%# Eval("KeyCharacters") %>' />
                <br />
                <span class="listviewLabel">Key Book:</span>
                <asp:Label ID="KeyBookLabel" runat="server" Text='<%# Eval("KeyBook") %>' />
                <br />
                <span class="listviewLabel">Scene Description:</span>
                <asp:Label ID="SceneDescriptionLabel" runat="server" 
                    Text='<%# Eval("SceneDescription") %>' />
                <br />
                <span class="listviewLabel">TwiWriter:</span>
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'><%# Eval("TwiWriter") %></a>
                <br />
                <span class="listviewLabel">Date Uploaded:</span>
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
                    </td>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server" border="0" style="">
                <tr ID="itemPlaceholderContainer" runat="server">
                    <td ID="itemPlaceholder" runat="server">
                    </td>
                </tr>
            </table>
            <div style="">
            </div>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <td runat="server" style="">
                KeyCharacters:
                <asp:Label ID="KeyCharactersLabel" runat="server" 
                    Text='<%# Eval("KeyCharacters") %>' />
                <br />
                KeyBook:
                <asp:Label ID="KeyBookLabel" runat="server" 
                    Text='<%# Eval("KeyBook") %>' />
                <br />
                SceneDescription:
                <asp:Label ID="SceneDescriptionLabel" runat="server" 
                    Text='<%# Eval("SceneDescription") %>' />
                <br />
                TwiWriter:
                <asp:Label ID="TwiWriterLabel" runat="server" Text='<%# Eval("TwiWriter") %>' />
                <br />
                DateUploaded:
                <asp:Label ID="DateUploadedLabel" runat="server" 
                    Text='<%# Eval("DateUploaded") %>' />
                <br />
            </td>
        </SelectedItemTemplate>
    </asp:ListView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>"  
        SelectCommand="SELECT [KeyCharacters], [KeyBook], [SceneDescription], [TwiWriter], [DateUploaded] FROM [SceneList] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    <%# Eval("TwiWriter")%>
    <asp:GridView class="detailsGridview" runat="server" AutoGenerateColumns="False" GridLines="None" 
        DataSourceID="SqlDataSource2">
        <Columns>
            <asp:HyperLinkField DataNavigateUrlFields="ExtraURL" DataTextField="ExtraURL" 
                HeaderText="Extra Information:" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT [ExtraURL] FROM [SceneList] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <hr />
    <br />

<%--TAGS--%>
    
    <span class="listviewLabel">Tags for this scene by the Twilighters Community:</span><br />

    <asp:BulletedList ID="BulletedList1" runat="server" 
        DataSourceID="SqlDataSource6" DataTextField="Tag" DataValueField="Tag" CssClass="tagList">
    </asp:BulletedList>
    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT DISTINCT [Tag], [ID] FROM [SceneTagView] WHERE ([ID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />

    <span class="listviewLabel">Choose a tag to describe this scene</span><br />

    <asp:DropDownList ID="ddl_tags" runat="server" DataSourceID="SqlDataSource3" 
        DataTextField="Tag" DataValueField="ID" Width="168px">
    </asp:DropDownList>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT [ID], [Tag] FROM [Tags] ORDER BY [Tag]"></asp:SqlDataSource>
    <asp:Button ID="btn_addExistingTag" runat="server" CssClass="addBtn" Text="Choose Tag" />
    <br /><br />
    <span class="listviewLabel">Add a new tag(s) separated by a comma</span><br />
    <asp:TextBox ID="tb_newTag" runat="server" Width="265px" Font-Names="Arial" 
        Font-Size="11pt" Height="23px"></asp:TextBox>
    <asp:Button ID="btn_addNewTag" runat="server" Text="Add new tag(s)" CssClass="addBtn" />
    <br /><br /><br />

<%--COMMENTS--%>

    <%# Eval("Timestamp")%>

    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataSourceID="commentsDS" CssClass="commentsGV" 
        AlternatingRowStyle-CssClass="altRowStyle" AllowPaging="True" PagerStyle-CssClass="pager" PageSize="5">
        <Columns>
            <asp:TemplateField HeaderText="TwiWriter">
            <ItemTemplate>
            <div style="word-wrap:break-word;">
                <span style="font-family: 'Milonga', Sans-Serif; font-size:12pt;">
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <%# Eval("TwiWriter")%></a></span><br />
                <span style="font: Arial; font-size: 12pt;">at <%# Eval("Timestamp")%></span>
            <br />
            <div>
            <asp:Image id="commentsAvatar" runat="server" ImageUrl='<%# Eval("AvatarFK")%>' />
            </div>
            </div>
            </ItemTemplate>

            <AlternatingItemTemplate>
            <div style="word-wrap:break-word;">
            <span style="font-family: 'Milonga', Sans-Serif; font-size:12pt;">
                <a href='Profile.aspx?TwiWriter=<%# Eval("TwiWriter") %>'>
                <%# Eval("TwiWriter")%></a></span><br />
                <span style="font: Arial; font-size: 12pt;">at <%# Eval("Timestamp")%></span>
             <br />
             <div class="avatarContainer">
            <asp:Image id="commentsAvatar" runat="server" ImageUrl='<%# Eval("AvatarFK")%>' CssClass="avatar" />
            </div>
            </div>
            </AlternatingItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField HeaderText="Comments on this scene">
            <ItemTemplate>
            <div style="word-wrap:break-word;">
            <span style="font: Arial; font-size: 12pt;word-wrap:break-word;">
                <%# Eval("Comment")%></span>
            </div>
            </ItemTemplate>

            <AlternatingItemTemplate>
            <div style="word-wrap:break-word;">
            <span style="font: Arial; font-size: 12pt;word-wrap:break-word;">
                <%# Eval("Comment")%></span>
            </div>
            </AlternatingItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="commentsDS" runat="server" 
        ConnectionString="<%$ ConnectionStrings:TwilightConn %>" 
        ProviderName="<%$ ConnectionStrings:TwilightConn.ProviderName %>" 
        SelectCommand="SELECT [TwiWriter], [Comment], [AvatarFK], [Timestamp] FROM [SceneComments] WHERE ([SceneFKID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="SceneFKID" QueryStringField="ID" Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br /><br />

 
    <div class="AddCommentDiv">
        <span class="listviewLabel">Add your comment Twilighter
        <asp:LoginName ID="LoginName1" runat="server" /></span>
        <br />
&nbsp;<asp:TextBox ID="tb_sceneComment" runat="server" Height="132px" 
            TextMode="MultiLine" Width="435px" Font-Names="Arial" Font-Size="12pt"></asp:TextBox>
        <br />
        <asp:Button ID="btn_sceneComment" runat="server" CssClass="addBtn" Text="Submit Comment" />
        <br />
        Please note that comments violating the <asp:HyperLink runat="server" Text="rules" Font-Size="11pt" NavigateUrl="~/About.aspx" />&nbsp;will 
        be removed.
    </div>
</asp:Content>
